/*
 * @Author: 一路向阳 tt_sunzhenfeng@163.com
 * @Date: 2024-05-27 19:22:59
 * @LastEditors: 一路向阳 tt_sunzhenfeng@163.com
 * @LastEditTime: 2024-05-30 13:49:35
 * @FilePath: \vue3_nuxt_demo\apis\upload.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { useHttpFetch, type IFetchOptions } from '@/composables/useHttpFetch';

// 文章图片上传腾讯云
interface IUploadCos extends IFetchOptions {
  file: File;
}

export const uploadCosFile = (opt: IUploadCos) => {
  return useHttpFetch('/api/upload/cos_file', {
    ...opt,
    method: 'POST',
    key: 'uploadCosFile'
  });
}